// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt

frappe.ui.form.on('Sales Order', {
    setup: function (frm) {
		frm.set_query("mrp_bom_no", "items", function(doc, cdt, cdn) {
			const row = locals[cdt][cdn];
			return {
				"filters": {
					'company': frm.doc.company,
					'docstatus': 1,
					'is_active': 1,
					'name':['!=',row.bom_no],
					'item': row.item_code
				}
			};
		});
	}
	
})